export interface UserTask {
  taskName?: string;
  taskStatus?: number;
  taskProperty?: number;
  handlerName?: string;
  taskDefKey?: string;
  taskStatusName?: string;
  taskRecordId?: string; // 待审批才有的数据
  innerProcDefId?: string;
  procInstId?: string;
  handlerComment?: string;
  isEndNode?: number;
  handlerTime?: string;
  handlerIcon?: string;
  noAvator?: number;
}

export interface TaskItem {
  handlerComment: string;
  handlerName: string;
  innerProcDefId: string;
  procInstId: string;
  taskDefKey: string;
  taskName: string;
  taskRecordId: string;
  taskStatusName: string;
  handlerTime?: string;
  handlerIcon?: string;
  noAvator?: number;
}

export interface CsUserTask {
  handlerComment: string;
  handlerName: string;
  handlerTime: string;
  innerProcDefId: string;
  procInstId: string;
  taskDefKey: string;
  taskName: string;
  taskRecordId: string;
  taskType: number;
  handlerIcon?: string;
}

export interface HistoryTask {
  taskName?: string;
  taskDefKey?: string;
  nodeStatus?: number;
  nodeStatusName?: string;
  nodeType?: number;
  csUserTasks?: CsUserTask[];
  userTasks: UserTask[];
}

// Task
export interface Variable {
  formValues: string;
  formModelData: string;
  exception?: string;
}

export interface TaskFormData {
  variables?: Variable;
  showBusinessKey?: boolean;
  formValues?: any;
  formModelData?: any;
  exception?: any;
}

export interface IApprovalItem {
  procRecordId?: any;
  readStatus?: number; // 0未读 1已读
  uid: string;
  taskDefKey?: string; // 流程定义id，用于取当前节点的表单权限
  icon?: string;
  sponsorIcon: string;
  department: string;
  taskName?: string;
  taskStatus?: number;
  taskStatusName?: string;
  taskRecordId?: string;
  innerProcDefId: string;
  procInstId: string;
  procNo: string;
  procName: string;
  procStatus: number;
  procStatusName: string;
  crtTime: string;
  historyTask: HistoryTask[];
  formData: TaskFormData;
  sponsorName?: string;
}

export interface IApprovalData {
  srvTime: number;
  status: number;
  data: IApprovalItem[];
  pageNum: number;
  pageSize: number;
  total: number;
}
